<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <input type="text" id="inp" value=""><button id="btn">点击</button>
    <script>
        var inp = document.getElementById("inp").value;
        var btn = document.getElementById("btn");
        btn.onclick = function (){
            var score = inp.value;
            if ( score >= 80 && score <= 100 ){
                alert("优秀");
            } else if ( score >= 70 && score < 80 ){
                alert("良好");
            } else if ( score >= 60 && score < 70 ){
                alert("及格");
            } else if ( score >= 0 && score < 60 ){
                alert("不及格");
            }
        }
    </script>
</body>
</html>